<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改员工档案')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-profile-edit" th:object="${staffProfile}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">登录名称：</label>
                <div class="col-sm-8">
                    <select name="userId"  class="form-control m-b" th:field="*{userId}" required disabled th:with="type=${@customDictService.selectUserList()}">
                        <option th:each="dict : ${type}" th:text="${dict.loginName}" th:value="${dict.userId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">姓　　名：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">在职状态：</label>
                <div class="col-sm-8">
                    <select name="onboardStatus" class="form-control m-b" th:with="type=${@dict.getType('onboard_status')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{onboardStatus}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">成本中心：</label>
                <div class="col-sm-8">
                    <select name="businessUnitDepartmentId" class="form-control" th:field="*{businessDepartmentId}" th:with="type=${@customDictService.selectDictBusinessUnitWithDepartments()}">
                        <option value="">请选择</option>
                        <optgroup th:each="unit: ${type}" th:label="${unit.name}">
                            <option th:each="department : ${unit.departments}" th:text="${department.name}" th:value="${department.id}"></option>
                        </optgroup>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">性　　别：</label>
                <div class="col-sm-8">
                    <select name="gender" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{gender}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">身份证：</label>
                <div class="col-sm-8">
                    <input name="idNumber" id="idNumber" th:field="*{idNumber}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">手机号码：</label>
                <div class="col-sm-8">
                    <input name="mobile" id="mobile" th:field="*{mobile}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">工资卡银行：</label>
                <div class="col-sm-8">
                    <input name="bankName" th:field="*{bankName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">工资卡支行：</label>
                <div class="col-sm-8">
                    <input name="bankBranch" th:field="*{bankBranch}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">工资卡号：</label>
                <div class="col-sm-8">
                    <input name="bankNumber" th:field="*{bankNumber}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">民　　族：</label>
                <div class="col-sm-8">
                    <input name="nation" th:field="*{nation}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">籍　　贯：</label>
                <div class="col-sm-8">
                    <input name="nativePlace" th:field="*{nativePlace}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">生　　日：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="birthday" th:value="${#dates.format(staffProfile.birthday, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否已婚：</label>
                <div class="col-sm-8">
                    <select name="married" class="form-control m-b" th:field="*{married}" th:with="type=${@dict.getType('sys_yes_no')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">居住地址：</label>
                <div class="col-sm-8">
                    <input name="livingPlace" class="form-control">[[*{livingPlace}]]</input>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">微信/qq：</label>
                <div class="col-sm-8">
                    <input name="contact" th:field="*{contact}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">籍贯地址：</label>
                <div class="col-sm-8">
                    <input name="birthPlace" class="form-control">[[*{birthPlace}]]</input>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">城镇户口：</label>
                <div class="col-sm-8">
                    <select name="urban" class="form-control m-b" th:field="*{urban}" th:with="type=${@dict.getType('sys_yes_no')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">上次社保城市：</label>
                <div class="col-sm-8">
                    <input name="lastInsuranceCity" th:field="*{lastInsuranceCity}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">公积金账号：</label>
                <div class="col-sm-8">
                    <input name="accumulationFundAccount" th:field="*{accumulationFundAccount}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">学　　历：</label>
                <div class="col-sm-8">
                    <select name="educationLevel"  class="form-control m-b" th:field="*{educationLevel}"  th:with="type=${@dict.getType('education_level')}">
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">毕业学校：</label>
                <div class="col-sm-8">
                    <input name="highSchool" th:field="*{highSchool}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">证书编号：</label>
                <div class="col-sm-8">
                    <input name="graduationNumber" th:field="*{graduationNumber}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">入职时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="onboardDate" th:value="${#dates.format(staffProfile.onboardDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">离职时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="departDate" th:value="${#dates.format(staffProfile.departDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">紧急联系方式：</label>
                <div class="col-sm-8">
                    <input name="emergeContact" th:field="*{emergeContact}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-select-js" />
    <script th:inline="javascript">
        var prefix = ctx + "erp/profile";
        $("#form-profile-edit").validate({
            focusCleanup: true,
            rules:{
                idNumber: {
                    isIdentity:true
                },
                mobile: {
                    isPhone: true
                }
            }
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-profile-edit').serialize());
            }
        }

        $("input[name='birthday']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='onboardDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='departDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>